VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "msdatgrd.ocx"
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "comdlg32.ocx"
Object = "{B3FB64BF-91F9-11D7-A482-0008A14158BC}#2.22#0"; "ITGControls.ocx"
Begin VB.Form frmMaintEmployee 
   BackColor       =   &H00F7D9C2&
   BorderStyle     =   0  'None
   Caption         =   "Form1"
   ClientHeight    =   6000
   ClientLeft      =   0
   ClientTop       =   0
   ClientWidth     =   10740
   BeginProperty Font 
      Name            =   "Tahoma"
      Size            =   8.25
      Charset         =   0
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   KeyPreview      =   -1  'True
   LinkTopic       =   "Form1"
   MDIChild        =   -1  'True
   ScaleHeight     =   6000
   ScaleWidth      =   10740
   ShowInTaskbar   =   0   'False
   Begin ITGControls.ComunionFrames ComunionFrames1 
      Height          =   2145
      Left            =   0
      Top             =   3465
      Width           =   10590
      _ExtentX        =   18680
      _ExtentY        =   3784
      FrameColor      =   4210752
      BackColor       =   16243138
      FillColor       =   16243138
      RoundedCorner   =   0   'False
      Caption         =   "Information"
      Alignment       =   0
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ThemeColor      =   5
      ColorFrom       =   16243138
      ColorTo         =   16250865
      Begin VB.CommandButton cmdCreate 
         Caption         =   "Create Customer File"
         Height          =   330
         Left            =   4680
         TabIndex        =   20
         Top             =   1575
         Width           =   1905
      End
      Begin VB.ComboBox cboCountry 
         Height          =   315
         Left            =   1515
         Style           =   2  'Dropdown List
         TabIndex        =   16
         Top             =   1200
         Width           =   4080
      End
      Begin ITGControls.ITGTextBox txtCountry 
         Height          =   285
         Left            =   3930
         TabIndex        =   28
         Tag             =   "cboCountry"
         Top             =   1200
         Visible         =   0   'False
         Width           =   1335
         _ExtentX        =   2249
         _ExtentY        =   503
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Mandatory       =   -1  'True
         Label           =   "Country"
         BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         LabelWidth      =   0
         TextBoxWidth    =   1275
      End
      Begin ITGControls.ITGTextBox txtAddress 
         Height          =   285
         Left            =   210
         TabIndex        =   11
         Top             =   570
         Width           =   6375
         _ExtentX        =   11033
         _ExtentY        =   503
         SendKeysTab     =   -1  'True
         BackColor       =   14745599
         LabelBackColor  =   16243138
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Mandatory       =   -1  'True
         Label           =   "Address"
         BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         LabelWidth      =   1280
         TextBoxWidth    =   5035
         Required        =   -1  'True
      End
      Begin ITGControls.ITGTextBox txtFax 
         Height          =   285
         Left            =   6825
         TabIndex        =   15
         Top             =   885
         Width           =   3225
         _ExtentX        =   5477
         _ExtentY        =   503
         SendKeysTab     =   -1  'True
         LabelBackColor  =   16243138
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Label           =   "Fax"
         BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         LabelWidth      =   900
         TextBoxWidth    =   2265
      End
      Begin ITGControls.ITGTextBox txtInternet 
         Height          =   285
         Left            =   6825
         TabIndex        =   18
         Top             =   1185
         Width           =   3225
         _ExtentX        =   5477
         _ExtentY        =   503
         SendKeysTab     =   -1  'True
         LabelBackColor  =   16243138
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Label           =   "Website"
         BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         LabelWidth      =   900
         TextBoxWidth    =   2265
      End
      Begin ITGControls.ITGTextBox txtEMail 
         Height          =   285
         Left            =   6825
         TabIndex        =   19
         Top             =   1515
         Width           =   3225
         _ExtentX        =   5477
         _ExtentY        =   503
         SendKeysTab     =   -1  'True
         LabelBackColor  =   16243138
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Label           =   "E-mail"
         BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         LabelWidth      =   900
         TextBoxWidth    =   2265
      End
      Begin ITGControls.ITGTextBox txtCity 
         Height          =   285
         Left            =   210
         TabIndex        =   13
         Top             =   885
         Width           =   3735
         _ExtentX        =   6376
         _ExtentY        =   503
         SendKeysTab     =   -1  'True
         LabelBackColor  =   16243138
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Label           =   "City / State"
         BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         LabelWidth      =   1280
         TextBoxWidth    =   2395
      End
      Begin ITGControls.ITGTextBox txtState 
         Height          =   285
         Left            =   3945
         TabIndex        =   14
         Top             =   885
         Width           =   2640
         _ExtentX        =   4551
         _ExtentY        =   503
         SendKeysTab     =   -1  'True
         LabelBackColor  =   16243138
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Label           =   "Street"
         BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         LabelWidth      =   0
         TextBoxWidth    =   2580
      End
      Begin ITGControls.ITGTextBox txtZip 
         Height          =   285
         Left            =   5595
         TabIndex        =   17
         Top             =   1200
         Width           =   990
         _ExtentX        =   1640
         _ExtentY        =   503
         SendKeysTab     =   -1  'True
         LabelBackColor  =   16243138
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Label           =   "Street"
         BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         LabelWidth      =   0
         TextBoxWidth    =   930
      End
      Begin ITGControls.ITGTextBox txtPhone 
         Height          =   285
         Left            =   6825
         TabIndex        =   12
         Top             =   570
         Width           =   3225
         _ExtentX        =   5477
         _ExtentY        =   503
         SendKeysTab     =   -1  'True
         LabelBackColor  =   16243138
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Label           =   "Phone"
         BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         LabelWidth      =   900
         TextBoxWidth    =   2265
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "Country / Zip"
         Height          =   195
         Left            =   225
         TabIndex        =   29
         Top             =   1350
         Width           =   945
      End
   End
   Begin MSComctlLib.StatusBar sbRS 
      Align           =   2  'Align Bottom
      Height          =   255
      Left            =   0
      TabIndex        =   23
      Top             =   5745
      Width           =   10740
      _ExtentX        =   18944
      _ExtentY        =   450
      _Version        =   393216
      BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628} 
         NumPanels       =   2
         BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            Object.Width           =   3528
            MinWidth        =   3528
         EndProperty
         BeginProperty Panel2 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
         EndProperty
      EndProperty
   End
   Begin ITGControls.ITGTab SSTab2 
      Height          =   4590
      Left            =   0
      TabIndex        =   24
      Top             =   1020
      Width           =   10590
      _ExtentX        =   18680
      _ExtentY        =   8096
      TabCount        =   2
      TabCaption(0)   =   "               Main               "
      TabContCtrlCnt(0)=   16
      Tab(0)ContCtrlCap(1)=   "cboPosition"
      Tab(0)ContCtrlCap(2)=   "txtPosition"
      Tab(0)ContCtrlCap(3)=   "cboType"
      Tab(0)ContCtrlCap(4)=   "txtAdvAcct"
      Tab(0)ContCtrlCap(5)=   "txtAcctName"
      Tab(0)ContCtrlCap(6)=   "cd"
      Tab(0)ContCtrlCap(7)=   "txtDept"
      Tab(0)ContCtrlCap(8)=   "txtDeptName"
      Tab(0)ContCtrlCap(9)=   "txtType"
      Tab(0)ContCtrlCap(10)=   "txtName"
      Tab(0)ContCtrlCap(11)=   "txtCode"
      Tab(0)ContCtrlCap(12)=   "Timer1"
      Tab(0)ContCtrlCap(13)=   "cmdDept"
      Tab(0)ContCtrlCap(14)=   "cmdPickAdvAcct"
      Tab(0)ContCtrlCap(15)=   "Label2"
      Tab(0)ContCtrlCap(16)=   "iPhoto"
      TabCaption(1)   =   "               List               "
      TabContCtrlCnt(1)=   1
      Tab(1)ContCtrlCap(1)=   "dtgList"
      TabTheme        =   2
      ActiveTabBackStartColor=   16250865
      ActiveTabBackEndColor=   16243138
      InActiveTabBackStartColor=   16243138
      InActiveTabBackEndColor=   16243138
      BeginProperty ActiveTabFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      BeginProperty InActiveTabFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      OuterBorderColor=   4210752
      TopLeftInnerBorderColor=   4210752
      BottomRightInnerBorderColor=   4210752
      DisabledTabBackColor=   16243138
      DisabledTabForeColor=   -2147483630
      Begin MSDataGridLib.DataGrid dtgList 
         Height          =   2145
         Left            =   -75000
         TabIndex        =   21
         Top             =   315
         Width           =   10590
         _ExtentX        =   18680
         _ExtentY        =   3784
         _Version        =   393216
         AllowUpdate     =   0   'False
         AllowArrows     =   -1  'True
         Appearance      =   0
         HeadLines       =   1
         RowHeight       =   15
         TabAction       =   2
         FormatLocked    =   -1  'True
         BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ColumnCount     =   3
         BeginProperty Column00 
            DataField       =   "cEmpCode"
            Caption         =   "Employee ID"
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   1033
               SubFormatType   =   0
            EndProperty
         EndProperty
         BeginProperty Column01 
            DataField       =   "cEmpName"
            Caption         =   "Employee Name"
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   1033
               SubFormatType   =   0
            EndProperty
         EndProperty
         BeginProperty Column02 
            DataField       =   "cAddress"
            Caption         =   "Address"
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   "#,##0.00"
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   1033
               SubFormatType   =   0
            EndProperty
         EndProperty
         SplitCount      =   1
         BeginProperty Split0 
            AllowRowSizing  =   0   'False
            BeginProperty Column00 
               ColumnAllowSizing=   -1  'True
               Locked          =   -1  'True
               ColumnWidth     =   1695.118
            EndProperty
            BeginProperty Column01 
               Locked          =   -1  'True
               ColumnWidth     =   4064.882
            EndProperty
            BeginProperty Column02 
               Locked          =   -1  'True
               ColumnWidth     =   4020.095
            EndProperty
         EndProperty
      End
      Begin VB.ComboBox cboPosition 
         Height          =   315
         ItemData        =   "frmMaintEmployee.frx":0000
         Left            =   1740
         List            =   "frmMaintEmployee.frx":0002
         Style           =   2  'Dropdown List
         TabIndex        =   3
         Top             =   1140
         Width           =   2475
      End
      Begin ITGControls.ITGTextBox txtPosition 
         Height          =   285
         Left            =   435
         TabIndex        =   26
         Tag             =   "cboCountry"
         Top             =   1185
         Width           =   2430
         _ExtentX        =   4075
         _ExtentY        =   503
         LabelBackColor  =   16243138
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Mandatory       =   -1  'True
         Label           =   "Position"
         BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         LabelWidth      =   1280
         TextBoxWidth    =   1090
         Required        =   -1  'True
      End
      Begin VB.ComboBox cboType 
         Height          =   315
         ItemData        =   "frmMaintEmployee.frx":0004
         Left            =   4965
         List            =   "frmMaintEmployee.frx":0006
         Style           =   2  'Dropdown List
         TabIndex        =   4
         Top             =   1140
         Width           =   2280
      End
      Begin ITGControls.ITGTextBox txtAdvAcct 
         Height          =   285
         Left            =   435
         TabIndex        =   8
         Tag             =   "C"
         Top             =   1785
         Width           =   2550
         _ExtentX        =   4286
         _ExtentY        =   503
         SendKeysTab     =   -1  'True
         BackColor       =   14745599
         LabelBackColor  =   16243138
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         AllCaps         =   -1  'True
         MaxLength       =   8
         Mandatory       =   -1  'True
         Label           =   "Adv.Account"
         BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         LabelWidth      =   1280
         TextBoxWidth    =   1210
         Required        =   -1  'True
      End
      Begin ITGControls.ITGTextBox txtAcctName 
         Height          =   285
         Left            =   3360
         TabIndex        =   10
         Top             =   1785
         Width           =   3900
         _ExtentX        =   6773
         _ExtentY        =   503
         SendKeysTab     =   -1  'True
         BackColor       =   14737632
         LabelBackColor  =   16243138
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         AllCaps         =   -1  'True
         Locked          =   -1  'True
         Label           =   "ITGtext"
         BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         LabelWidth      =   0
         TextBoxWidth    =   3840
         Enabled         =   0   'False
      End
      Begin MSComDlg.CommonDialog cd 
         Left            =   9690
         Top             =   1830
         _ExtentX        =   847
         _ExtentY        =   847
         _Version        =   393216
      End
      Begin ITGControls.ITGTextBox txtDept 
         Height          =   285
         Left            =   435
         TabIndex        =   5
         Tag             =   "C"
         Top             =   1470
         Width           =   2550
         _ExtentX        =   4286
         _ExtentY        =   503
         SendKeysTab     =   -1  'True
         BackColor       =   14745599
         LabelBackColor  =   16243138
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         AllCaps         =   -1  'True
         Mandatory       =   -1  'True
         Label           =   "Department"
         BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         LabelWidth      =   1280
         TextBoxWidth    =   1210
         Required        =   -1  'True
      End
      Begin ITGControls.ITGTextBox txtDeptName 
         Height          =   285
         Left            =   3360
         TabIndex        =   7
         Top             =   1470
         Width           =   3900
         _ExtentX        =   6773
         _ExtentY        =   503
         SendKeysTab     =   -1  'True
         BackColor       =   14737632
         LabelBackColor  =   16243138
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         AllCaps         =   -1  'True
         Locked          =   -1  'True
         Label           =   "ITGtext"
         BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         LabelWidth      =   0
         TextBoxWidth    =   3840
         Enabled         =   0   'False
      End
      Begin ITGControls.ITGTextBox txtType 
         Height          =   285
         Left            =   5505
         TabIndex        =   25
         Top             =   1155
         Visible         =   0   'False
         Width           =   1215
         _ExtentX        =   2037
         _ExtentY        =   503
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Mandatory       =   -1  'True
         Label           =   "Internal Terms"
         BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         LabelWidth      =   0
         TextBoxWidth    =   1155
      End
      Begin ITGControls.ITGTextBox txtName 
         Height          =   285
         Left            =   435
         TabIndex        =   2
         Top             =   840
         Width           =   6825
         _ExtentX        =   11827
         _ExtentY        =   503
         SendKeysTab     =   -1  'True
         BackColor       =   14745599
         LabelBackColor  =   16243138
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Mandatory       =   -1  'True
         Label           =   "Employee Name"
         BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         LabelWidth      =   1280
         TextBoxWidth    =   5485
         Required        =   -1  'True
      End
      Begin ITGControls.ITGTextBox txtCode 
         Height          =   285
         Left            =   435
         TabIndex        =   1
         Top             =   525
         Width           =   2580
         _ExtentX        =   4339
         _ExtentY        =   503
         SendKeysTab     =   -1  'True
         BackColor       =   14745599
         LabelBackColor  =   16243138
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         AllCaps         =   -1  'True
         MaxLength       =   10
         Mandatory       =   -1  'True
         Label           =   "Employee ID"
         BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         LabelWidth      =   1280
         TextBoxWidth    =   1240
         Required        =   -1  'True
      End
      Begin VB.Timer Timer1 
         Interval        =   300
         Left            =   3015
         Top             =   465
      End
      Begin VB.CommandButton cmdDept 
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   270
         Left            =   3030
         Picture         =   "frmMaintEmployee.frx":0008
         Style           =   1  'Graphical
         TabIndex        =   6
         Top             =   1500
         Width           =   300
      End
      Begin VB.CommandButton cmdPickAdvAcct 
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   270
         Left            =   3015
         Picture         =   "frmMaintEmployee.frx":0152
         Style           =   1  'Graphical
         TabIndex        =   9
         Top             =   1815
         Width           =   315
      End
      Begin VB.Label Label2 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "Type"
         Height          =   195
         Left            =   4410
         TabIndex        =   27
         Top             =   1230
         Width           =   360
      End
      Begin VB.Image iPhoto 
         Appearance      =   0  'Flat
         BorderStyle     =   1  'Fixed Single
         DataField       =   "iPhoto"
         Height          =   1815
         Left            =   7935
         Stretch         =   -1  'True
         Top             =   525
         Width           =   2265
      End
   End
   Begin VB.Image imgLogo 
      BorderStyle     =   1  'Fixed Single
      Height          =   930
      Left            =   9465
      Stretch         =   -1  'True
      Top             =   0
      Width           =   1125
   End
   Begin VB.Shape Shape1 
      BorderColor     =   &H00404040&
      Height          =   960
      Left            =   0
      Top             =   0
      Width           =   9390
   End
   Begin VB.Label lblHeader 
      BackColor       =   &H00F7D9C2&
      Caption         =   "Employee ID - Employee Name"
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   375
      Left            =   165
      TabIndex        =   22
      Top             =   150
      Width           =   8955
   End
   Begin VB.Label lblDetails 
      BackColor       =   &H00F7D9C2&
      Caption         =   "Address"
      ForeColor       =   &H00000000&
      Height          =   255
      Left            =   165
      TabIndex        =   0
      Top             =   510
      Visible         =   0   'False
      Width           =   9270
   End
End
Attribute VB_Name = "frmMaintEmployee"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'IT Group Inc. 2005.08.17

Option Explicit

'Object variables





'Recordset variables
Private WithEvents rsHeader As ADODB.Recordset
Attribute rsHeader.VB_VarHelpID = -1

'ADO Connection variables

Private connHeader As ADODB.Connection

'Form mode enumeration
Public Enum eEmpMode
    Normal
    AddNewEdit
    Find
End Enum
Private Mode As eEmpMode

'Other declaration
Public dtgName As String
Public sBit As String
Private vBM As Variant 'Recordset bookmark variable

Private sTempPath As String ' Path of the Picture : Temporary
Private stm As New ADODB.Stream

'Security Acess Level variables
Public lACNew As Boolean
Public lACEdit As Boolean
Public lACDelete As Boolean
Public lACPost As Boolean
Public lACCancel As Boolean
Public lACPrint As Boolean

Private Sub cboCountry_Click()
    txtCountry = Trim(cboCountry)
End Sub

Private Sub cboCountry_KeyPress(KeyAscii As Integer)
    SendKeysTab KeyAscii
End Sub

Private Sub cmdCreate_Click()
If Mode = AddNewEdit Then Exit Sub
Dim rsCustomer As New ADODB.Recordset
Dim rsCustomerCL As New ADODB.Recordset
    If Trim(txtCode) = "" Then Exit Sub
    cString = "EM-" & Trim$(rsHeader!cEmpCode)
    If GetValueFrTable("cCode", "CLIENT_CUSTOMER", "cCode='" & Trim(cString) & "'") <> "" Then
        If MsgBox("Customer File already exist. Do you want to continue?", vbYesNo + vbInformation, "Comunioin") = vbNo Then Exit Sub
    End If
    
    cn.Execute ("DELETE CLIENT_CUSTOMER WHERE cCompanyID = '" & COID & "' AND cCode = '" & Trim(cString) & "'")
    cn.Execute ("DELETE CLIENT_CUSTOMER_CL WHERE cCompanyID = '" & COID & "' AND cCode = '" & Trim(cString) & "'")
    
    OpenRecordset rsCustomer, "*", "CLIENT_CUSTOMER", "WHERE 1 = 0"
    OpenRecordset rsCustomerCL, "*", "CLIENT_CUSTOMER_CL", "WHERE 1 = 0"
    
    With rsCustomer
        .AddNew
        !cCompanyID = COID
        !cCode = Trim$(cString)
        !cName = rsHeader!cEmpName
        !lCompany = False
        !lIndividual = True
        !cCustomerType = "Employee"
        !cAddress = rsHeader!cAddress
        !cCity = rsHeader!cCity
        !cState = rsHeader!cState
        !cCountry = rsHeader!cCountry
        !cZip = rsHeader!cZip
        !cFax = rsHeader!cFax
        !cInternet = rsHeader!cInternet
        !cEMail1 = rsHeader!cEMail
        !cTerm = "15"
        !cIntTerm = "15"
        !cMSCode = "NONE"
    End With
    
    With rsCustomerCL
        .AddNew
        !cCompanyID = COID
        !cCode = Trim$(cString)
        !cType = "MS"
        !cClassCode = "NONE"
        !cDescription = "NONE"
        !nLimit = 20000
    End With
    
    rsCustomer.UpdateBatch adAffectAll
    rsCustomerCL.UpdateBatch adAffectAll
    
    Set rsCustomer = Nothing
    Set rsCustomerCL = Nothing
    
    MsgBox "Customer File successfully create.", vbInformation, "Comunion"
End Sub

Private Sub cmdDept_Click()
    If lPickListActive Then Exit Sub
    sFilterString = Trim(txtDept)
    frmITGPicker.zType = QSecDepartment
    frmITGPicker.Condition = "where cCompanyID = '" & COID & "'" 'added gino
    frmITGPicker.Show vbModal
    txtDept = frmITGPicker.zCode
    txtDeptName = frmITGPicker.zName
    If Trim(txtDeptName) <> "" Then SendKeys "{Tab}"
End Sub

Private Sub cmdPickAdvAcct_Click()
    If lPickListActive Then Exit Sub
    sFilterString = Trim(txtAdvAcct)
    frmITGPicker.zType = QAccounts
    frmITGPicker.Condition = "where cCompanyID = '" & COID & "'" 'added gino
    frmITGPicker.Show vbModal
    txtAdvAcct = frmITGPicker.zCode
    txtAcctName = frmITGPicker.zName
    If Trim(txtAcctName) <> "" Then SendKeys "{Tab}"
End Sub

Private Sub dtgList_HeadClick(ByVal ColIndex As Integer)
    SortGrid dtgList, ColIndex, rsHeader
End Sub

Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
Dim iKey As Integer
    iKey = ToolbarIndex(KeyCode, Shift)
    If iKey <> 0 Then
        If ITGLedgerMain.tbrMain.Buttons(iKey).Enabled = True Then
            ToolbarFunction iKey
        End If
    End If
End Sub

'Set Your Object
Private Sub Form_Load()
        
    Set FrmName = Me
    FormSetup
    
    AcessBit Me, GetValueFrTable("AccessLevel", "SEC_ACCESSLEVEL", "RoleID = '" & SecUserRole & "' AND [Module] = 'MF10'")
    
    Set rsHeader = New ADODB.Recordset
    
    
    'CallComboBox Values
    Call LoadComboValues(cboCountry, "cValue", "PARAMETER_SYSTEM", "WHERE cType = 'COUNTRY'")
    Call LoadComboValues(cboType, "cValue", "PARAMETER_SYSTEM", "WHERE cType = 'EMPTYPE'")
    Call LoadComboValues(cboPosition, "cParamName", "PARAMETER_USER", "WHERE cType = 'POSITION' AND cCompanyID='" & COID & "'")
    
    FormLocking True
    FormSearch True
    SearchObj True
    BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, lACNew, , , , , , , , , True, , , True
    BitVisible ITGLedgerMain.tbrMain, True
    ITGLedgerMain.tbrMain.Buttons("btnFind").ButtonMenus("btnFindP").Enabled = True
    
    imgLogo.Picture = ITGLedgerMain.Picture1.Picture
    Mode = Find
    txtCode.Locked = False
    
End Sub

'Activate your Toolbar Mode
Private Sub Form_Activate()
    TBBitReload
End Sub

'Release your Object
Private Sub Form_Unload(Cancel As Integer)
On Error Resume Next
    If Mode = AddNewEdit Then
        MsgBox "Unable to close. You are in Add/New/Edit mode." & vbCr & _
            " Must Save or Undo", vbCritical, Me.Caption
        Cancel = True
        Exit Sub
    End If
    
    CloseMenuTab ITGLedgerMain
    
    BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, , , , , , , , , , True
    BitVisible ITGLedgerMain.tbrMain
    ITGLedgerMain.tbrMain.Buttons("btnFind").ButtonMenus("btnFindP").Enabled = False
    
    
    
    
    
    Set rsHeader = Nothing
    Set connHeader = Nothing
    
    Set frmMaintEmployee = Nothing

    lCloseWindow = True
    
'    'oForm(Me.Tag).Mode = 1
'    'oForm(Me.Tag).Tag = Me.Tag
End Sub

'Add new record to the recordset
Public Sub TBNew()
    
    BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, , , , True, True, , , True, True, , , , True
    txtCode.BackColor = &HE0FFFF
    Mode = AddNewEdit
    
    If rsHeader.State <> adStateOpen Then
        OpenNewConnection connHeader
        OpenRecordsetWithCN rsHeader, "*", "EMPLOYEE", connHeader, "WHERE 1 = 0"
        SetDataSource
        SetDataField
    Else
        vBM = rsHeader.Bookmark
    End If
    
    rsHeader.AddNew
    rsHeader!cCompanyID = COID
    cboCountry = "Philippines"
    cboType = "Regular"
    cboPosition = "Salesman"
    
    Set FrmName = Me
    FormLocking False
    ClrRequired &HC0&
    txtCode.SetFocus

End Sub

'Undo all changes to the recordset
Public Sub TBUndoAll()
On Error GoTo ErrorHandler

    Mode = Normal
    
    If rsHeader.Status = adRecNew Then TBUndoCurrent
    
    rsHeader.CancelBatch adAffectAll
    
    UnbindControls
    
    If rsHeader.RecordCount <> 0 Then rsHeader.Bookmark = vBM
    
    Set FrmName = Me
    FormLocking True
    
    If rsHeader.RecordCount <> 0 Then
        BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, lACNew, lACEdit, lACDelete, , , , , , , True, True, , True
    Else
        RSZero
        Mode = Find
    End If
    
    sbRS.Panels(2) = ""
    
    SetDataSource
    SetDataField

ErrorHandler:
    If err.Number = -2147217885 Then
        Resume Next
    ElseIf err.Number = -2147217842 Then 'Operation was cancelled. (Error returned by ITGDateBox)
        TBUndoAll
    End If

End Sub

'Undo changes on the current record
Public Sub TBUndoCurrent()
On Error GoTo ErrorHandler

    If rsHeader.Status = adRecNew Then
        rsHeader.CancelUpdate
    Else
        rsHeader.CancelBatch adAffectCurrent
    End If
   
    If rsHeader.RecordCount = 0 Then RSZero
    
ErrorHandler:
    If err.Number = -2147217885 Then
        Resume Next
    ElseIf err.Number = -2147217842 Then 'Operation was cancelled. (Error returned by ITGDateBox)
        TBUndoCurrent
    End If

End Sub

'Save all changes
Public Sub TBSave()
Dim OKUpdate As Boolean
On Error GoTo ErrHandler

    'Audit Trail
    lBoolean = False
    If rsHeader.Status = adRecNew Then lBoolean = True
    
    If Not MandatoryOK Then Exit Sub
    
    OKUpdate = False
    cn.BeginTrans
    connHeader.BeginTrans
    
    rsHeader.UpdateBatch adAffectAll
    
    cn.CommitTrans
    connHeader.CommitTrans
    OKUpdate = True
    
    Set FrmName = Me
    FormLocking True
    
    BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, lACNew, lACEdit, lACDelete, , , , , , , True, True, , True
    Mode = Normal
    
    MsgBox "Record/s successfully saved.", vbInformation, "iTG Finance Manager"
    SetDataSource
    'Audit trail
    UpdateLogFile "Employee", Trim(txtCode), IIf(lBoolean, "Inserted", "Updated")
    
    lblHeader = rsHeader!cCode & " - " & rsHeader!cName & ""
    lblDetails = rsHeader!cAddress & ""
    sbRS.Panels(2) = ""

ErrHandler:
    If err.Number = -2147217885 Then
        Resume Next
    ElseIf err.Number = -2147217864 Then
        OKUpdate = True
        cn.RollbackTrans
        connHeader.RollbackTrans
        MsgBox "Record cannot be updated. Some values may have been changed by other user/s since last read." & vbCr & _
                "Records will be automatically refreshed. All changes made to the record will be gone upon refresh.", vbInformation, "iTG Finance Manager"
        vBookMark = rsHeader.Bookmark
        UnbindControls
        rsHeader.Requery
        BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, lACNew, lACEdit, lACDelete, , , , , , , True, True, , True
        Mode = Normal
        If rsHeader.RecordCount <> 0 Then
            Set FrmName = Me
            FormLocking True
            SetDataField
            SetDataSource
            rsHeader.Bookmark = vBookMark
        Else
            RSZero
        End If
    End If
    If Not OKUpdate Then
        MsgBox "Transaction update failed.", vbInformation, "iTG Finance Manager"
        cn.RollbackTrans
        connHeader.RollbackTrans
        ErrorLog err.Number, err.Description, Me.Name 'Error log
    End If
    
End Sub

'Sets the form & recorset to add/edit mode
Public Sub TBEdit()
    Mode = AddNewEdit
    BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, , , , , , , , True, True, , , , True
    Set FrmName = Me
    FormLocking False
    ClrRequired &HC0&
    txtCode.Locked = True
    SSTab2.ActiveTab = 0
    txtName.SetFocus
    vBM = rsHeader.Bookmark
End Sub

'Delete record
Public Sub TBDelete()
On Error GoTo ErrorHandler
    
    If rsHeader.RecordCount = 0 Then Exit Sub
    
    Dim rs As New ADODB.Recordset
    Set rs = Nothing
    rs.Open "SELECT A.cSMan FROM VSalesman A, Salesman B WHERE A.cCompanyID = B.cCompanyID and A.cSMan = '" & Trim(txtCode) & "' ", cn, adOpenStatic
    
    If rs.RecordCount <> 0 Then
        MsgBox "Unable to delete. Referenced by other transactions.", vbExclamation, "ALERT"
        rs.Close
        GoTo ErrorHandler
    End If
    
    If MsgBox("Are you sure you want to delete this record?", vbQuestion + vbYesNo, "iTG Finance Manager") = vbNo Then Exit Sub
    
    'Audit trail
    UpdateLogFile "Employee", Trim(txtCode), "Deleted"

    rsHeader.Delete adAffectCurrent
    rsHeader.UpdateBatch adAffectAll

    TBPrevRec

    Mode = Normal
    
    If rsHeader.RecordCount = 0 Then
        RSZero
    End If

ErrorHandler:
    If err.Number = -2147217885 Then
        Resume Next
    End If

End Sub

'Search using the frmITGSearch
Public Sub TBFind()
    Mode = Normal
    
    txtCode.Locked = True
    frmITGSearch.Show
End Sub

'Search using the recordset primary key
Public Sub TBFindPrimary()
Dim sTemp As String
If Mode = Find Then
    FormWaitShow App.Path & "\Transmit.avi", "Loading data . . ."
            
    OpenNewConnection connHeader
    
    Set rsHeader = Nothing
    Set rsHeader = New ADODB.Recordset
            
    sTemp = Trim$(GetSearchString)
    If sTemp = "ERROR" Then
        MsgBox "Only Allows A - Z, 0 - 9, '.', ',' and %(wildcard)", vbExclamation, ""
        BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, lACNew, , , , , , , , , True, , , True
        txtCode.Locked = False
        txtCode.SetFocus
        Exit Sub
    End If
    
    OpenRecordsetWithCN rsHeader, "*", "EMPLOYEE", connHeader, IIf(sTemp = "", "", " WHERE " & sTemp)
                        
    Set FrmName = Me
    FormLocking True
             
    If rsHeader.RecordCount = 0 Then
        FormWaitHide
        MsgBox "No matching record/s found.", vbInformation, "ComUnion Search"
        RSZero
        FormSearch True
        SearchObj True
        Mode = Find
        Exit Sub
    End If
    SetDataSource
    SetDataField
    txtCode.BackColor = &HE0FFFF
    Mode = Normal
    BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, lACNew, lACEdit, lACDelete, , , , , , , True, True, , True

    FormWaitHide
Else
    RSZero
    FormSearch True
    SearchObj True
    Mode = Find

End If

End Sub

'Reload menu buttons (do not delete this sub)
Public Sub TBBitReload()
    BitVisible ITGLedgerMain.tbrMain
    ITGLedgerMain.tbrMain.Buttons("btnFind").ButtonMenus("btnFindP").Enabled = True
    BitReload ITGLedgerMain, Me, ITGLedgerMain.tbrMain, sBit
    Set FrmName = Me
End Sub

'Close active window
Public Sub TBCloseWindow()
    Unload Me
End Sub

'Move first
Public Sub TBFirstRec()
    If rsHeader.State <> adStateOpen Then Exit Sub
    MoveFirst rsHeader

End Sub

'Move previous
Public Sub TBPrevRec()
    If rsHeader.State <> adStateOpen Then Exit Sub
    MovePrevious rsHeader

End Sub

'Move next
Public Sub TBNextRec()
    If rsHeader.State <> adStateOpen Then Exit Sub
    MoveNext rsHeader

End Sub

'Move last
Public Sub TBLastRec()
    If rsHeader.State <> adStateOpen Then Exit Sub
    MoveLast rsHeader
    
End Sub

'Add new line to the detail recordset
Public Sub TBNewLine()
    'Not Available
End Sub

'Delete line in the detail recordset
Public Sub TBDeleteLine()
On Error GoTo ErrorHandler


ErrorHandler:
    If err.Number = -2147217885 Then
        Resume Next
    End If

End Sub

'Undo all
Public Sub TBUndoLineAll()
On Error GoTo ErrorHandler

ErrorHandler:
    If err.Number = -2147217885 Then
        Resume Next
    End If
End Sub

'Undo current line
Public Sub TBUndoLineCurrent()
    MsgBox "Unavailable on " & Me.Name
End Sub

'Post current record
Public Sub TBPostRecord()
    MsgBox "Unavailable on " & Me.Name
End Sub

'Cancel current record
Public Sub TBCancelRecord()
    MsgBox "Unavailable on " & Me.Name
End Sub

'Print
Public Sub TBPrintRecord()
    MsgBox "Unavailable on " & Me.Name
End Sub

'Sets the data source of the controls
Sub SetDataSource()
    Set FrmName = Me
    BindControls rsHeader
    Set dtgList.DataSource = rsHeader
   
End Sub
    
'Sets the data field for every bounded controls
Sub SetDataField()
    With rsHeader
        txtCode.DataField = !cEmpCode
        txtName.DataField = !cEmpName
        txtAddress.DataField = !cAddress
        txtType.DataField = !cEmpType
        txtCity.DataField = !cCity
        txtState.DataField = !cState
        txtCountry.DataField = !cCountry
        txtZip.DataField = !cZip
        txtPhone.DataField = !cTel
        txtFax.DataField = !cFax
        txtInternet.DataField = !cInternet
        txtEMail.DataField = !cEMail
        txtPosition.DataField = !cPosition
        txtDept.DataField = !cDept
        txtAdvAcct.DataField = !cAdvAccount
    End With
End Sub

Private Sub rsHeader_MoveComplete(ByVal adReason As ADODB.EventReasonEnum, ByVal pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset)
On Error GoTo ErrorHandler
    
    If Not (rsHeader.EOF) Or Not (rsHeader.BOF) Then
        lblHeader = rsHeader!cEmpCode & " - " & rsHeader!cEmpName & ""
        lblDetails = rsHeader!cAddress & ""
        sbRS.Panels(1) = "Record: " & IIf((rsHeader.AbsolutePosition = -2), "0", rsHeader.AbsolutePosition) & "/" & rsHeader.RecordCount
        
        If rsHeader.Status <> adRecNew Then
            txtCode.Locked = True
        Else
            txtCode.Locked = False
        End If
        
        If Mode = AddNewEdit Then
            Select Case rsHeader.Status
                Case adRecNew
                    sbRS.Panels(2) = "New"
                Case adRecModified
                    sbRS.Panels(2) = "Modified"
                Case Else
                    sbRS.Panels(2) = ""
            End Select
        Else
            sbRS.Panels(2) = ""
        End If
    Else
        lblHeader = "Employee ID - Employee Name"
        lblDetails = "Address"
        sbRS.Panels(1) = "Record: 0/0"
        sbRS.Panels(2) = ""
        txtCode.Locked = False
    End If
    

ErrorHandler:
    'Err.Number -2147217885
    'Description - Row handle referred to a deleted row or a row marked for deletion.
    If err.Number = -2147217885 Then
        Resume Next
    End If
    
End Sub

Private Sub Timer1_Timer()
    If Mode = AddNewEdit Then
        SSTab2.TabEnabled(1) = False
        cmdCreate.Enabled = False
    Else
        SSTab2.TabEnabled(1) = True
        cmdCreate.Enabled = True
    End If
End Sub

Private Sub txtAdvAcct_Change()
    txtAcctName = ""
    txtAcctName = GetValueFrTable("cTitle", "ACCOUNT", "cAcctNo = '" & Trim(txtAdvAcct) & "'")
End Sub

Private Sub txtAdvAcct_LostFocus()
    If Mode <> AddNewEdit Then Exit Sub
    If Trim(txtAcctName) = "" And Trim(txtAdvAcct) <> "" Then cmdPickAdvAcct_Click
End Sub

Private Sub txtCode_LostFocus()
    'Does Code Already exists
    If Mode = AddNewEdit Then
        If Trim(txtCode) = "" Then
            MsgBox "Empty primary input.", vbInformation, "iTG Finance Manager"
            If FrmName.Name <> Me.Name Then PreviousTab frmComUnionMenuTab
            txtCode.SetFocus
        Else
            If rsHeader.Status <> adRecNew Then Exit Sub
            txtCode = Trim(txtCode)
            If IDExisting(rsHeader, "cEmpCode", "EMPLOYEE", Trim(rsHeader!cEmpCode)) Then
                MsgBox "Employee ID already exists.", vbInformation, "ITGLedger"
                If FrmName.Name <> Me.Name Then PreviousTab frmComUnionMenuTab
                txtCode.SetFocus
            End If
        End If
    End If
End Sub

Private Sub txtCountry_Change()
    If Trim(txtCountry) <> "" Or txtCountry <> vbNullString Then
        cboCountry = Trim(txtCountry)
    Else
        cboCountry.ListIndex = -1
    End If
End Sub

'Check if all mandatory fields are complete
Function MandatoryOK() As Boolean
    
    MandatoryOK = True
    
    If Trim(txtCode) = "" Then
        MandatoryOK = False
        MsgBox "Field 'Employee ID' is mandatory. Null value is not allowed.", vbInformation, "iTG Finance Manager"
        txtCode.SetFocus
        Exit Function
    End If
    
    If rsHeader.Status = adRecNew Then
        If IDExisting(rsHeader, "cEmpCode", "EMPLOYEE", Trim(rsHeader!cEmpCode)) Then
            MandatoryOK = False
            MsgBox "Employee ID already exists.", vbInformation, "iTG Finance Manager"
            txtCode.SetFocus
            Exit Function
        End If
    End If
    
    If Trim(txtName) = "" Then
        MandatoryOK = False
        MsgBox "Field 'Employee Name' is mandatory. Null value is not allowed", vbInformation, "iTG Finance Manager"
        txtName.SetFocus
        Exit Function
    ElseIf Trim(txtAddress) = "" Then
        MandatoryOK = False
        MsgBox "Field 'Address' is mandatory. Null value is not allowed", vbInformation, "iTG Finance Manager"
        txtAddress.SetFocus
        Exit Function
    ElseIf Trim(txtCountry) = "" Then
        MandatoryOK = False
        MsgBox "Field 'Country' is mandatory. Null value is not allowed", vbInformation, "iTG Finance Manager"
        cboCountry.SetFocus
        Exit Function
    End If

End Function

'Filter detail recordset to header's primary
Private Sub GetChild()
    '^&@$^#^@!#_^$!#$!
End Sub
Private Function GetSearchString() As String
On Error GoTo ErrorHandler
Dim sWhere As String

    GetSearchString = True

    If Trim$(txtCode.Text) <> "" Then
        sWhere = sWhere & IIf(Trim$(sWhere) = "", "", " AND ") & " cEmpCode LIKE '" & Trim$(txtCode.Text) & "%'"
    End If

    If Trim$(txtName.Text) <> "" Then
        sWhere = sWhere & IIf(Trim$(sWhere) = "", "", " AND ") & " cEmpName LIKE '" & Trim$(txtName.Text) & "%'"
    End If
    
    If Trim$(txtPosition.Text) <> "" Then
        sWhere = sWhere & IIf(Trim$(sWhere) = "", "", " AND ") & " cPosition LIKE '" & Trim$(txtPosition.Text) & "%'"
    End If
    
    If Trim$(txtType.Text) <> "" Then
        sWhere = sWhere & IIf(Trim$(sWhere) = "", "", " AND ") & " cEmpType LIKE '" & Trim$(txtType.Text) & "%'"
    End If
    
    If Trim$(txtCity.Text) <> "" Then
        sWhere = sWhere & IIf(Trim$(sWhere) = "", "", " AND ") & " cCity LIKE '" & Trim$(txtCity.Text) & "%'"
    End If
    
    GetSearchString = Trim$(sWhere)

    Exit Function
ErrorHandler:
    GetSearchString = "ERROR"
End Function

'Sets the form if record number is zero
Private Sub RSZero()
    lblHeader = "Employee ID - Employee Name"
    lblDetails = "Address"
    sbRS.Panels(1) = "Record: 0/0"
    sbRS.Panels(2) = ""
    
    Set FrmName = Me
    UnbindControls
    TextClearing
    FormLocking True
  
    If rsHeader.State = adStateOpen Then rsHeader.Close
    
    BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, lACNew, , , , , , , , , True, , , True
    
    txtCode.Locked = False
    txtCode.SetFocus
    
    Mode = Find
End Sub

Sub SearchObj(lEnable As Boolean)
    cboType.Enabled = lEnable
    cboPosition.Enabled = lEnable
End Sub

Private Sub cboType_Click()
    txtType = Trim(cboType)
End Sub

Private Sub cboType_KeyPress(KeyAscii As Integer)
    SendKeysTab KeyAscii
End Sub

Private Sub txtDept_Change()
    txtDeptName = ""
    txtDeptName = GetValueFrTable("Description", "SEC_DEPARTMENT", "DeptID = '" & Trim(txtDept) & "'", True)
End Sub

Private Sub txtDept_LostFocus()
    If Mode <> AddNewEdit Then Exit Sub
    If Trim(txtDeptName) = "" And Trim(txtDept) <> "" Then cmdDept_Click
End Sub

Private Sub txtType_Change()
    If Trim(txtType) <> "" Or txtType <> vbNullString Then
        cboType = Trim(txtType)
    Else
        cboType.ListIndex = -1
    End If
End Sub

Private Sub cboPosition_Click()
    txtPosition = Trim(cboPosition)
End Sub

Private Sub cboPosition_KeyPress(KeyAscii As Integer)
    SendKeysTab KeyAscii
End Sub

Private Sub txtPosition_Change()
    If Trim(txtPosition) <> "" Or txtPosition <> vbNullString Then
        cboPosition = Trim(txtPosition)
    Else
        cboPosition.ListIndex = -1
    End If
End Sub

Public Sub TBBrowseImage()
    
    ' Browse for picture then load on PictureBox
    cd.Filter = "Bitmap (*.bmp)|*.bmp| JPEG (*.jpg;*.jpeg)|*.jpg;*.jpeg| GIF (*.gif)|*.gif| All (*.bmp;*.jpg;*.jpeg;*.gif)|*.bmp;*.jpg;*.jpeg;*.gif"
    cd.FilterIndex = 4
    cd.FileName = ""
    cd.ShowOpen

    sTempPath = Trim$(cd.FileName)
    If (Trim(sTempPath) <> "") Then
        iPhoto.Picture = LoadPicture(sTempPath)
    Else
        iPhoto.Picture = Nothing
        Exit Sub
    End If

    If (iPhoto.Picture <> 0) Then
        stm.Type = adTypeBinary
        stm.Open
        stm.LoadFromFile sTempPath
        rsHeader!iPhoto = stm.Read
        stm.Close
        Set stm = Nothing
    Else
        rsHeader!iPhoto = Null
    End If

End Sub

Public Sub TBClearImage()
    iPhoto.Picture = Nothing
    rsHeader!iPhoto = Null
End Sub

Private Sub iPhoto_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Mode <> AddNewEdit Then Exit Sub
    If Button = 2 Then PopupMenu ITGLedgerMain.mnuImage
End Sub

Private Sub iPhoto_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Mode = AddNewEdit Then
        iPhoto.ToolTipText = "Right click to add/remove image"
    Else
        iPhoto.ToolTipText = ""
    End If
End Sub

'Public Sub ShowForm(sTranNo As String)
'    If Mode = Find Then
'
'        OpenNewConnection connHeader
'
'        Set rsHeader = Nothing
'        Set rsHeader = New ADODB.Recordset
'
'        OpenRecordsetWithCN rsHeader, "*", "EMPLOYEE", connHeader, "WHERE cEmpCode = '" & Trim(sTranNo) & "'"
'
'        Set FrmName = Me
'        FormLocking True
'
'        If rsHeader.RecordCount = 0 Then
'            FormWaitHide
'            MsgBox "No matching record/s found.", vbInformation, "ComUnion Search"
'            RSZero
'            FormSearch True
'            SearchObj True
'            Mode = Find
'            Exit Sub
'        End If
'            SetDataSource
'            SetDataField
'            txtCode.BackColor = &HE0FFFF
'            Mode = Normal
'            oBar.BitEnabled Me, ITGLedgerMain.tbrMain, lACNew, lACEdit, lACDelete, , , , , , , True, True, , True, True
'
'    End If
'End Sub
